<?php
$this->breadcrumbs=array(
	$title,
);
include_once('menu.php');
?>

<style>
td {
	border: solid #68BADA;
	border-width: 0px 1px 1px 0px;
	padding: 5px;
	text-align: center
}
table {
	border: solid #68BADA;
	border-width: 1px 0px 0px 1px;
}
.odd {
	background: none repeat scroll 0 0 #EEEEEE;
}
.even {
	background: none repeat scroll 0 0 #FFFFFF;
}
.three {
	background: none repeat scroll 0 0 #E5F1F4;
}
.jg {
	background: none repeat scroll 0 0 #ADD9ED;
}
.head {
	background: none repeat scroll 0 0 #90D8F0;
}
input, img {
	vertical-align: middle;
}
</style>
<?php
$this->widget('application.extensions.fancybox.EFancyBox', array('target' => '.fan', 'config' => array('width' => 520, 'height' => 176,'type'=>'iframe','hideOnOverlayClick'=>false,'onClosed'=>'js:function(){window.location.href="'.Yii::app()->createUrl("admin/slide",array('class'=>$class)).'";}')));
$this->widget('application.extensions.fancybox.EFancyBox', array('target' => '.pic'));
?>
<div style="margin:0 0 10px 0; width:100%; text-align:right;">
<a style="margin:0 20px 0 0;" class="fan" href="<?=Yii::app()->createUrl("admin/slideAdd",array('class'=>$class,'size'=>$size))?>">新增</a>
</div>
<table cellspacing="0" cellpadding="0" width="100%" class="tbl">
	<?php
	if($class==3){
	?>
	<tr class="head">
		<td width="4%">ID</td>
		<td width="20%">圖片</td>
		<td width="20%">標題</td>
		<td width="40%">鏈接</td>
		<td width="8%">排序</td>
		<td>操作</td>		
	</tr>
	<?php
	}else{
	?>
	<tr class="head">
		<td width="4%">ID</td>
		<td width="20%">圖片</td>
		<td width="60%">鏈接</td>
		<td width="8%">排序</td>
		<td>操作</td>		
	</tr>
	<?php
	}
	?>	
	<?php
    $i = 0;
    $cssArr = array(0 => 'even', 1 => 'odd', 2 => 'three');
    foreach ($rowTable as $item) {
        $trClass = $cssArr[$i % 3];
        $i++;
        ?>
	<tr class="<?= $trClass ?>">
		<td>
			<?=$i?>
		</td>
		<td>
			<a class="pic" href="<?=Yii::app()->params['slidePath']?>/<?=$item->pic?>"><?=$item->pic?></a>
		</td>
		<?php
		if($class==3){
		?>
		<td>
			<?=$item->title?>
		</td>
		<?php
		}
		?>
		<td>
			<?=$item->link?>
		</td>
		<td>
			<?=$item->hot?>
		</td>
		<td><a href="<?=Yii::app()->createUrl("admin/slideDel",array('id'=>$item->sid,'class'=>$class))?>">刪除</a></td>
	</tr>
	<?php
    }
    ?>
</table>